package com.pb.web.action;

import com.opensymphony.xwork2.ActionSupport;
import com.pb.entity.User;

/**
 * 以属性方式接收用户输入的用户名和密码
 * 
 * @author Jovi 2015年12月28日 UserAction.java
 */
public class UserAction extends ActionSupport {

	private static final long serialVersionUID = -1783819998312712862L;

	private User user;

	/**
	 * 获取 user
	 * 
	 * @return user
	 */
	public User getUser() {
		return user;
	}

	/**
	 * 设置 user
	 * 
	 * @param user
	 *            user
	 */
	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public String execute() throws Exception {
		return "success";
	}

	/**
	 * 处理用户登录
	 */
	public String login() {
		if (user.getUserName().equals("accp") && user.getPassWord().equals("111")) {
			return SUCCESS;
		}else {
			return INPUT;
		}
	}
}
